<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<html>
<body class="easyui-layout list_body">
<form id="errorReportForm" name="errorReportForm">
    <div class="list_body_north" data-options="region:'north'" border="false">
        <!-- 查询表单 -->
        <div style="padding: 3px" class="easyui-panel datagrid-toolbar">
            <div>
                <span>APP类型:</span>
                <td><code:codeSelect id="app_type" name="app_type"  code_type="APP_TYPE" selectId="${infEntity.app_type}"></code:codeSelect></td>
                <span>版本号:</span>
                <input id="client_version" type="text" name="client_version"  class="easyui-textbox"  >
                <span>开始日期:</span>
                <input type="text" id="start_date" name="start_date" class="easyui-datebox" data-options="editable:false" value="${lastMonth}"/>
                <span>结束日期:</span>
                <input type="text" id="end_date" name="end_date" class="easyui-datebox" data-options="editable:false" value="${currentDate}"/>
                <a href="#" class="easyui-linkbutton btn" iconCls="icon-search" onclick="doSearch()">查询</a>
                <a href="#" class="easyui-linkbutton btn" iconCls="icon-reload" onclick="resetForm()">重置</a>
            </div>
        </div>
        <!-- 自定义标签工具栏 -->
        <jiepos:buttonOperateTag menuCode="${menuCode}"></jiepos:buttonOperateTag>
    </div>
    <div data-options="region:'center'" border="false" class="list_body_center">
        <!-- 表格 -->
        <table id="errorReportTableId" fit="true"></table>
    </div>
</form>
</body>
<script type="text/javascript">
    var grid;
    $(function() {
        /*加载表格数据*/
        grid = $("#errorReportTableId").jpgrid({
            url : "errorReportListJson.do",
            columns : [
                {title: "客户端登陆账号", field: "LOGIN_ID",width:100},
                {title: "APP类型", field: "APP_TYPE",width:80},
                {title: "APP的唯一编号", field: "APP_ID",width:150},
                {title: "客户端系统名称", field: "SYSTEMNAME",width:200},
                {title: "客户端android或ios系统的终端标识码", field: "SYSTEMUUID",width:280},
                {title: "系统版本", field: "SYSTEMVERSION",width:80},
                {title: "设备型号", field: "SYSTEMDEVICEMODEL",width:80},
                {title: "客户端版本", field: "CLIENT_VERSION",width:100} 
            ]
        });
    });

    function doSearch() {
        grid.load({
            start_date : $('#start_date').val(),
            end_date : $('#end_date').val(),
            app_type : $('#app_type').val(),
            client_version : $('#client_version').val()
        });
    }

    //
    function downFile(url) {
        var checkedItems = $('#errorReportTableId').datagrid('getChecked');
        if (checkedItems.length == 0) {
            $.jpmessage.warning("请选择一条记录！");
            return false;
        }else if(checkedItems.length > 1){
            $.jpmessage.warning("只能选择一条记录！");
            return false;
        }
        var path = checkedItems[0].FILE_PATH;
        commonFileDownload(url + encodeURI(path), "errorReportForm");
    }
</script>
</html>
